<!-- application/layouts/scripts/head.phtml -->
<div id="header">
<table style="width:100%"><tr>
	<td style="width:30%">
		<b>极爱CY</b>
	</td>
	<td style="text-align:center">
		<a href="/">广场</a>&nbsp;|&nbsp;
		<?php
		if (!isset($_SESSION['userinfo'])) {?>
			我的家
		<?php }else{?>
			<a href="/?uid=<?php echo $_SESSION['userinfo']['uid'];?>">我的家</a>
		<?php } ?>
	</td>
	<td style="text-align:right; width:30%">
	<?php		
	if (!isset($_SESSION['userinfo'])) {?>
		<a id="login" href="#">login</a>
		&nbsp;|&nbsp;
		<a href="<?php echo $this->url(
		array('controller'=>'user'),
			'default',
		true) ?>">register</a>
		
	<?php } else {
		echo "Welcome ".$_SESSION['userinfo']['nickname']."&nbsp;!&nbsp;|&nbsp;"; 
	?>	
		<a href="<?php echo $this->url(
		array('controller'=>'user','action'=>'edit'),
			'default',
		true) ?>">Setting</a>
		&nbsp;|&nbsp;
		<a href="<?php echo $this->url(
		array('controller'=>'auth','action'=>'logout'),
			'default',
		true) ?>">logout</a>
	<?php } ?>
	
	</td>
</tr></table>
</div>
